dojo.declare("DAdminRegisterPg", wm.Page, {
start: function() {
this.lookup1.setShowing(false);
this.lookup2.setShowing(false);
},
"preferredDevice": "desktop",
checkboxVendorChange: function(inSender, inDisplayValue, inDataValue, inSetByCode) {
this.lookup1.setShowing(!inDataValue);
this.lookup2.setShowing(!inDataValue);
this.textAreaAddress.setShowing(inDataValue);
},
buttonRegistrationClick: function(inSender) {
if (this.textActivationCode.getDataValue() == undefined || this.textActivationCode.getDataValue() == "") return false;
if (this.emailEditor1.getDataValue() == undefined || this.emailEditor1.getDataValue() == "") return false;
if (this.passwordEditor1.getDataValue() == undefined || this.passwordEditor1.getDataValue() == "") return false;
if (this.nameEditor1.getDataValue() == undefined || this.nameEditor1.getDataValue() == "") return false;
if (this.primaryPhoneEditor1.getDataValue() == undefined || this.primaryPhoneEditor1.getDataValue() == "") return false;
if (!this.checkboxVendor.getChecked()) {
if (this.lookup1.dataValue == undefined || this.lookup1.dataValue == "") return false;
if (this.lookup2.dataValue == undefined || this.lookup2.dataValue == "") return false;
}
this.svRegisterUser.update();
},
lvBlocksSuccess: function(inSender, inDeprecated) {
var item = this.lookup1.dataSet.getItem(0);
this.lookup1.setDataValue(item);
},
lvDoorSuccess: function(inSender, inDeprecated) {
var item = this.lookup2.dataSet.getItem(0);
this.lookup2.setDataValue(item);
},
svRegisterUserSuccess1: function(inSender, inDeprecated) {
this.formPanel1.clearData();
},
_end: 0
});

DAdminRegisterPg.widgets = {
notificationCall1: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":"\"User Registered Successfully\"","targetProperty":"text"}, {}],
wire1: ["wm.Wire", {"expression":"5000","targetProperty":"duration"}, {}],
wire2: ["wm.Wire", {"expression":"\"Success\"","targetProperty":"cssClasses"}, {}],
wire3: ["wm.Wire", {"expression":"\"center center\"","targetProperty":"dialogPosition"}, {}]
}]
}]
}],
lvBlocks: ["wm.LiveVariable", {"autoUpdate":false,"inFlightBehavior":"executeLast","startUpdate":false,"type":"com.servicelivedb.data.Block"}, {"onSuccess":"lvBlocksSuccess"}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"textActivationCode.dataValue","targetProperty":"filter.project.projectId"}, {}]
}],
liveView: ["wm.LiveView", {"dataType":"com.servicelivedb.data.Block","view":[{"caption":"BlockId","sortable":true,"dataIndex":"blockId","type":"java.lang.Integer","displayType":"Number","required":true,"readonly":true,"includeLists":true,"includeForms":true,"order":0,"subType":null},{"caption":"BlockName","sortable":true,"dataIndex":"blockName","type":"java.lang.String","displayType":"Text","required":false,"readonly":false,"includeLists":true,"includeForms":true,"order":1,"subType":null}]}, {}]
}],
lvDoor: ["wm.LiveVariable", {"autoUpdate":false,"inFlightBehavior":"executeLast","startUpdate":false,"type":"com.servicelivedb.data.Door"}, {"onSuccess":"lvDoorSuccess"}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"lookup1.selectedItem","targetProperty":"filter.block"}, {}]
}],
liveView: ["wm.LiveView", {"dataType":"com.servicelivedb.data.Door","view":[{"caption":"DoorId","sortable":true,"dataIndex":"doorId","type":"java.lang.Integer","displayType":"Number","required":true,"readonly":true,"includeLists":true,"includeForms":true,"order":0,"subType":null},{"caption":"DoorName","sortable":true,"dataIndex":"doorName","type":"java.lang.String","displayType":"Text","required":false,"readonly":false,"includeLists":true,"includeForms":true,"order":1,"subType":null}]}, {}]
}],
svRegisterUser: ["wm.ServiceVariable", {"inFlightBehavior":"executeLast","operation":"registerVendor","service":"RegistrationService"}, {"onError":"notificationCall2","onSuccess":"notificationCall1","onSuccess1":"svRegisterUserSuccess1"}, {
input: ["wm.ServiceInput", {"type":"registerVendorInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"textActivationCode.dataValue","targetProperty":"activationCode"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"checkboxVendor.dataValue","targetProperty":"isVendor"}, {}],
wire2: ["wm.Wire", {"expression":undefined,"source":"passwordEditor1.dataValue","targetProperty":"customer.password"}, {}],
wire3: ["wm.Wire", {"expression":undefined,"source":"secondaryPhoneEditor1.dataValue","targetProperty":"customer.secondaryPhone"}, {}],
wire4: ["wm.Wire", {"expression":undefined,"source":"primaryPhoneEditor1.dataValue","targetProperty":"customer.primaryPhone"}, {}],
wire5: ["wm.Wire", {"expression":undefined,"source":"emailEditor1.dataValue","targetProperty":"customer.email"}, {}],
wire6: ["wm.Wire", {"expression":undefined,"source":"nameEditor1.dataValue","targetProperty":"customer.name"}, {}],
wire7: ["wm.Wire", {"expression":undefined,"source":"lookup2.selectedItem.doorId","targetProperty":"customer.door.doorId"}, {}],
wire8: ["wm.Wire", {"expression":undefined,"source":"lookup1.selectedItem.blockId","targetProperty":"customer.door.block.blockId"}, {}],
wire9: ["wm.Wire", {"expression":undefined,"source":"textActivationCode.dataValue","targetProperty":"customer.project.projectId"}, {}],
wire10: ["wm.Wire", {"expression":undefined,"source":"lookup1.selectedItem.blockId","targetProperty":"customer.block.blockId"}, {}],
wire11: ["wm.Wire", {"expression":undefined,"source":"textAreaAddress.dataValue","targetProperty":"customer.address"}, {}]
}]
}]
}],
notificationCall2: ["wm.NotificationCall", {"operation":"toast"}, {}, {
input: ["wm.ServiceInput", {"type":"toastInputs"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire1: ["wm.Wire", {"expression":"5000","targetProperty":"duration"}, {}],
wire3: ["wm.Wire", {"expression":"\"center center\"","targetProperty":"dialogPosition"}, {}],
wire: ["wm.Wire", {"expression":"\"User Registration Failed\"","targetProperty":"text"}, {}],
wire2: ["wm.Wire", {"expression":"\"Error\"","targetProperty":"cssClasses"}, {}]
}]
}]
}],
ldBlock: ["wm.LoadingDialog", {}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"layoutBox1","targetProperty":"widgetToCover"}, {}],
wire1: ["wm.Wire", {"expression":undefined,"source":"lvBlocks","targetProperty":"serviceVariableToTrack"}, {}]
}]
}],
layoutBox1: ["wm.Layout", {"horizontalAlign":"center","verticalAlign":"top"}, {}, {
formPanel1: ["wm.FormPanel", {"captionSize":"140px","desktopHeight":"422px","editorWidth":"70%","height":"422px","mobileHeight":"422px","type":"com.servicelivedb.data.Customer","width":"80%"}, {}, {
checkboxVendor: ["wm.Checkbox", {"caption":"Vendor","captionSize":"140px","desktopHeight":"26px","displayValue":true,"height":"26px","startChecked":true,"width":"70%"}, {"onchange":"checkboxVendorChange"}],
textActivationCode: ["wm.Number", {"caption":"Activation Code","captionSize":"140px","desktopHeight":"26px","displayValue":"","emptyValue":"null","formatter":"Number","height":"26px","required":true,"width":"70%"}, {"onchange":"lvBlocks"}, {
format: ["wm.NumberFormatter", {}, {}]
}],
emailEditor1: ["wm.Text", {"caption":"Email","captionSize":"140px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"26px","required":true,"width":"70%"}, {}],
passwordEditor1: ["wm.Text", {"caption":"Password","captionSize":"140px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"26px","password":true,"required":true,"width":"70%"}, {}],
nameEditor1: ["wm.Text", {"caption":"Name","captionSize":"140px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"26px","required":true,"width":"70%"}, {}],
textAreaAddress: ["wm.LargeTextArea", {"caption":"Address","captionAlign":"right","captionPosition":"left","captionSize":"140px","dataValue":undefined,"displayValue":"","width":"70%"}, {}],
lookup1: ["wm.Lookup", {"caption":"Block","captionSize":"140px","dataType":"com.servicelivedb.data.Block","dataValue":undefined,"desktopHeight":"26px","displayField":"blockName","displayValue":"","height":"26px","required":true,"width":"70%"}, {"onchange":"lvDoor"}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"lvBlocks","targetProperty":"dataSet"}, {}]
}]
}],
lookup2: ["wm.Lookup", {"caption":"Door","captionSize":"140px","dataType":"com.servicelivedb.data.Door","dataValue":undefined,"desktopHeight":"26px","displayField":"doorName","displayValue":"","height":"26px","required":true,"width":"70%"}, {}, {
binding: ["wm.Binding", {}, {}, {
wire: ["wm.Wire", {"expression":undefined,"source":"lvDoor","targetProperty":"dataSet"}, {}]
}]
}],
primaryPhoneEditor1: ["wm.Text", {"caption":"PrimaryPhone","captionSize":"140px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"26px","required":true,"width":"70%"}, {}],
secondaryPhoneEditor1: ["wm.Text", {"caption":"SecondaryPhone","captionSize":"140px","changeOnKey":true,"dataValue":"","desktopHeight":"26px","displayValue":"","emptyValue":"emptyString","height":"26px","width":"70%"}, {}],
panel3: ["wm.Panel", {"desktopHeight":"32px","enableTouchHeight":true,"height":"32px","horizontalAlign":"right","layoutKind":"left-to-right","mobileHeight":"40px","verticalAlign":"top","width":"70%"}, {}, {
buttonRegistration: ["wm.Button", {"caption":"Register","margin":"4"}, {"onclick":"buttonRegistrationClick"}]
}]
}]
}]
};

DAdminRegisterPg.prototype._cssText = '';
DAdminRegisterPg.prototype._htmlText = '';